package com.jk.mapper;


import com.jk.model.*;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface ZSLMapper {
    /**
     * 查询权限树
     * @param id
     * @return
     */
    @Select("select * from t_manage where  pid = #{value}")
    List<ManageBean> findManage(int id);

    /**
     * 查询用户总条数
     * @param param
     * @return
     */
    int findUserCount(HashMap<String, Object> param);

    /**
     * 查询用户信息
     * @param param
     * @return
     */
    List<UserBean> findUserList(HashMap<String, Object> param);

    void delUserById(Integer[] ids);

    int findUserShopCount(HashMap<String, Object> param);

    List<UserBean> findUserShopList(HashMap<String, Object> param);

    int shopTableCount(HashMap<String, Object> param);

    List<ProductBean> shopTableList(HashMap<String, Object> param);

    int findOrderCount(HashMap<String, Object> param);

    List<OrderBean> findOrderList(HashMap<String, Object> param);

    int findShopUserCount(HashMap<String, Object> param);

    List<UserBean> findShopUserList(HashMap<String, Object> param);

    int orderTableCount(HashMap<String, Object> param);

    List<OrderBean> orderTableList(HashMap<String, Object> param);

    @Select("select tp.*,ts.stockNumber from t_product tp " +
            "   left join t_stock ts on tp.productStockId=ts.id" +
            " where tp.id = #{value}")
    ProductBean queryProductByProductId(Integer productId);

    @Select("select * from t_user_acceptsite where userId = #{value};")
    List<AcceptsiteBean> chaAddress(int i);

    @Select("select * from t_product where id = #{value};")
    OrderBean chajiaoyi(Integer productId);
}
